'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  router.get('/', controller.home.index);
  router.resources('admin', '/api/admin', controller.admin);//管理员增删改查
  router.resources('users', '/api/users', controller.users);//用户增删改查
  router.post('/login', controller.login.index);//管理员登录
  router.post('/userlogin', controller.userlogin.login);//用户登录
  router.post('/userlogin/regist', controller.userlogin.regist);//用户注册
  router.resources('filmclass', '/api/filmclass', controller.filmclass);//电影分类
  router.resources('editselected', '/api/editselected', controller.editselected);//编辑精选
  router.resources('itson', '/api/itson', controller.itson);//首页正在上映
  router.resources('comingsoon', '/api/comingsoon', controller.comingsoon);//首页即将上映
  router.resources('filmreview', '/api/filmreview', controller.filmreview);//热门影评
  router.resources('inlandshow', '/api/inlandshow', controller.inlandshow);//部分内地正在上映
  router.resources('othershow', '/api/othershow', controller.othershow);//部分其他正在上映
  router.resources('allinland', '/api/allinland', controller.allinland);//全部内地正在上映
  router.resources('allshowing', '/api/allshowing', controller.allshowing);//全部正在热映
  router.resources('allother', '/api/allother', controller.allother);//全部其他即将上映
  router.resources('most', '/api/most', controller.most);//最受关注
  router.resources('timemovie', '/api/timemovie', controller.timemovie);//时光电影
  router.resources('chinesefilm', '/api/chinesefilm', controller.chinesefilm);//华语电影
  router.resources('mostfilm', '/api/mostfilm', controller.mostfilm);//最受关注电影
  router.post('/fileupload', controller.fileupload.uploadImg);//上传图片接口
  router.resources('hot', '/api/hot', controller.hot);//热门短评 
  router.resources('soulreview', '/api/soulreview', controller.soulreview);//灵魂点评
  router.resources('selectedcomment', '/api/selectedcomment', controller.selectedcomment);//精选评论
  router.resources('moviedetails', '/api/moviedetails', controller.moviedetails);//电影详情页
  router.resources('commentspecification', '/api/commentspecification', controller.commentspecification);//评论规范
  router.resources('weprivacy', '/api/weprivacy', controller.weprivacy);//联系我们和隐私政策
  router.resources('firstrotationchart', '/api/firstrotationchart', controller.firstrotationchart);//首页轮播图
  router.resources('filmrotationchart', '/api/filmrotationchart', controller.filmrotationchart);//热门讨论轮播图 
  router.resources('popularessays', '/api/popularessays', controller.popularessays);//热门讨论
  router.resources('commentdetails', '/api/commentdetails', controller.commentdetails);//评论详情
  
  
};
